package com.cf.user.login;

import com.cf.user.login.model.UserInfo;

/**
 * game-server-LoginUserHolder
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/5/31 下午 04:58
 */
public class LocalUserHolder {

    private static ThreadLocal<UserInfo> localUser = new ThreadLocal<>();

    public static void set(UserInfo userInfo) {
        localUser.set(userInfo);
    }

    public static UserInfo userInfo() {
        return localUser.get();
    }

    public static void clean() {
        localUser.remove();
    }

}
